*data available at https://brightlinewatch.org/survey-data-and-replication-material/ (wave 23 public survey, November 2024)

svyset _n, weight(weight) 

*demrep - 1 = democratic identifier or leaner, 0 = republican identifier or leaner
gen demrep = .
replace demrep = 1 if pid7 < 3.1
replace demrep = 0 if pid7 > 4.1 & pid7 < 7.1

*election related questions are IMP_US_1, 2, 3, 4, 6, 7, 8, 9, 10, 12, 

gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_1 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_1 if IMP_US_1 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_1 demrep 

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_2 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_2 if IMP_US_2 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_2 demrep 

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_3 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_3 if IMP_US_3 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_3 demrep
*p = 0.02

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_4 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_4 if IMP_US_4 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_4 demrep


drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_6 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_6 if IMP_US_6 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_6 demrep

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_7 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_7 if IMP_US_7 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_7 demrep
*p = 0.00

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_8 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_8 if IMP_US_8 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_8 demrep
*p = 0.00

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_9 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_9 if IMP_US_9 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_9 demrep

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_10 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_10 if IMP_US_10 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_10 demrep

drop flag
gen flag = 0 
replace flag = 1 if demrep < 2 & IMP_US_12 < 6
svy linearized, subpop(flag) : tabulate demrep IMP_US_12 if IMP_US_12 < 6, row pearson
svy linearized, subpop(flag): ologit IMP_US_12 demrep

*significant items: 3, 7, 8


